<template>
  <el-dialog
    :title="$t('customer.newMarketingTask')"
    :visible.sync="dialogVisible"
    width="90%"
    :show="show"
    :before-close="handleClose"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    append-to-body
  >
    <div class="app-container">
      <el-scrollbar
        ref="myScrollbar"
        :wrap-class="{ wrapClass: true }"
        class="form-scrollbar scrollbar-back-top"
      >
        <baseform
          :emailsTemp="emailsTemp"
          @closeAction="refresh()"
          :source="source"
        />
      </el-scrollbar>
    </div>
  </el-dialog>
</template>

<script>
import baseform from '@/views/email/emailServerSend/add'
export default {
  name: 'EmailAdd',
  components: { baseform },
  props: {
    show: {
      type: Boolean,
      default: false,
    },
    emailsTemp: '',
    closeAction: {
      type: String,
      default: '',
    },
  },
  mounted() {
    console.log(this.emailsTemp, 2)
  },
  data() {
    return {
      dialogVisible: this.show,
      source: 1,
    }
  },
  methods: {
    refresh() {
      this.$emit('closeAction')
    },
    handleClose(done) {
      this.$emit('update:show', false)
      this.$emit('closeAction')
    },
  },
  watch: {
    show() {
      this.dialogVisible = this.show
    },
  },
}
</script>

<style scoped>
.form-scrollbar {
  height: calc(100vh - 350px);
}
deep .tox-tinymce-aux {
  z-index: 999999;
}
</style>
